<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="box">
        <button @click="a='lee2'">改变</button>
        <component :is="a"></component>
    </div>
</body>
<script src="./vue.js"></script>
<script>
    Vue.component('lee', {
        template:"<p>hello lee</p>"
    })
    Vue.component('lee2', {
        template:"<p>hello lee2</p>"
    })
    new Vue({
        el:"#box",
        data:{
            a:'lee'
        }
    })
</script>
</html>